package com.gobuy.goods.controller;


import com.gobuy.common.pojo.Result;
import com.gobuy.common.pojo.StatusCode;
import com.gobuy.goods.service.SpecService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
 * @author GaoZeXi
 */
@RestController
@CrossOrigin
@RequestMapping("/spec")
public class SpecController {
    @Autowired
    private SpecService specService;

    @GetMapping("/category/{categoryName}")
    private Result<List<Map>> findSpecListByCategoryName(@PathVariable("categoryName") String categoryName){
        List<Map> specList = specService.findSpecListByCategoryName(categoryName);
        return new Result<>(true, StatusCode.OK,"查询成功",specList);
    }

}
